package com.fengmi.goods.mapper;

import com.fengmi.goods.entity.MallGoods;
import com.fengmi.goods.entity.MallGoodsCat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fengmi.goods.vo.GoodsCatVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品类目 Mapper 接口
 * </p>
 *
 * @author zhuxm
 * @since 2022-03-02
 */
public interface MallGoodsCatMapper extends BaseMapper<MallGoodsCat> {


    public List<GoodsCatVo> findGoodsCatCascade();


    @Select("SELECT * FROM mall_goods_cat  cat\n" +
            "WHERE cat.id IN\n" +
            "(SELECT DISTINCT category3_id FROM mall_goods)")
    public List<MallGoodsCat> findGoodsCatHasGoods();


}
